package com.cedric.yixianpai.game.cards.Sects.swordCards.c_JinDan;

import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class YunWuJue extends SwordCard {
    /**
     * title:云舞诀
     * effect:SE+2/3/4 盾+2/3/4 SI+2/3/4
     */
    public YunWuJue(@Value("1") int lvl) {
        super("云舞诀");
        this.setPeriod(Period.JINDAN);
        this.setDescription("灵气+2/3/4 护盾+2/3/4 剑意+2/3/4");
        this.setLevel(lvl);

        if (1 == lvl) {
            this.setSpiritAdd(2);
            this.setShield(2);
            this.setSwordIntent(2);
        } else if (2 == lvl) {
            this.setSpiritAdd(3);
            this.setShield(3);
            this.setSwordIntent(3);
        } else if (3 == lvl) {
            this.setSpiritAdd(4);
            this.setShield(4);
            this.setSwordIntent(4);
        } else {
            throw new RuntimeException("Card Level Error!");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.getPlayerBuff().addSpiritualEnergy(this.getSpiritAdd());
        Sta1.getPlayerBuff().addShield(this.getShield());
        Sta1.getPlayerBuff().addSwordIntent(this.getSwordIntent());
        return true;
    }
}
